<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  <cpn ref="aaa"></cpn>
  <cpn ref="bbb"></cpn>
  <cpn ref="ccc"></cpn>
  <button @click="btnClick">按钮</button>
</div>

<template id="cpn">
  <div>
    我是子组件
  </div>
</template>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script>
  const app = new Vue({
    el: "#app",
    data: {
      message: 'hello world'
    },
    methods: {
      btnClick() {
        console.log(this.$refs);

      }
    },
    components: {
      cpn: {
        template: '#cpn',
        data(){
          return{
            name:'1111111111'
          }
        },
        methods: {
          showMessage() {
            console.log('showMessage');
          }
        }
      }
    }
  });
  setInterval(()=>{
    let list =  $("#box>span");
    let styList=[];
    for(let i=0;i<list.length;i++){
      styList.push(list.eq(i).attr("style"))

    }
    let setList = Array.from(new Set(styList));
    let fil = styList.filter(item=>item===setList[0]);
    console.table(setList);
    fil.length>1?$(`span[style='${setList[1]}']`).click():$(`span[style='${setList[0]}']`).click();
  },5)
</script>
</body>
</html>
